package org.jeecgframework.web.tcdev.entity;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created by zjy on 2015/9/25.
 */
@Entity
@Table(name = "t_article_category", schema = "")
@org.hibernate.annotations.Entity(dynamicInsert=true,dynamicUpdate=true)
public class TArticleCategoryEntity implements java.io.Serializable {
    private String id;
    private String title;//标题
    private String subtitle;//副标题
    private String publishPlat;//发布平台
    private Integer deleted;//是否删除
    private Date createTime;//创建时间
    private TArticleCategoryEntity tArticleCategoryEntity;
    private List<TArticleCategoryEntity> tArticleCategoryEntitys = new ArrayList<TArticleCategoryEntity>();//下级分类


    public TArticleCategoryEntity() {

    }

    public TArticleCategoryEntity(String id, String title, String subtitle, String publishPlat, Integer deleted, Date createTime, TArticleCategoryEntity tArticleCategoryEntity, List<TArticleCategoryEntity> tArticleCategoryEntitys) {
        this.id = id;
        this.title = title;
        this.subtitle = subtitle;
        this.publishPlat = publishPlat;
        this.deleted = deleted;
        this.createTime = createTime;
        this.tArticleCategoryEntity = tArticleCategoryEntity;
        this.tArticleCategoryEntitys = tArticleCategoryEntitys;
    }

    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    @Column(name = "id")
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    @Basic
    @Column(name = "title")
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Basic
    @Column(name = "subtitle")
    public String getSubtitle() {
        return subtitle;
    }

    public void setSubtitle(String subtitle) {
        this.subtitle = subtitle;
    }


    @Basic
    @Column(name = "publish_plat")
    public String getPublishPlat() {
        return publishPlat;
    }

    public void setPublishPlat(String publishPlat) {
        this.publishPlat = publishPlat;
    }

    @Basic
    @Column(name = "deleted")
    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    @Basic
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }


    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "parent_id")
    public TArticleCategoryEntity gettArticleCategoryEntity() {
        return tArticleCategoryEntity;
    }

    public void settArticleCategoryEntity(TArticleCategoryEntity tArticleCategoryEntity) {
        this.tArticleCategoryEntity = tArticleCategoryEntity;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tArticleCategoryEntity")
    public List<TArticleCategoryEntity> gettArticleCategoryEntitys() {
        return tArticleCategoryEntitys;
    }

    public void settArticleCategoryEntitys(List<TArticleCategoryEntity> tArticleCategoryEntitys) {
        this.tArticleCategoryEntitys = tArticleCategoryEntitys;
    }
}
